package Stream.中间操作符;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Limit {
    public static void main(String[] args) {
        List<String> strings = Arrays.asList("ainde","dfdf","qwer","dfde");
        // limit(3) 返回集合的前面三个  [ainde, dfdf, qwer]
        System.out.println(strings.stream().limit(3).collect(Collectors.toList()));
    }
}
